package example;

import java.util.ArrayList;

public class Relation
{
	ArrayList<Tuples> list  = new ArrayList<Tuples>();
    public int ENDPOS = -1;

    
    public int position = 0;
    public int getPosition()
    {
         return position;
    }

    public Tuples getKey()
    {
       return list.get(position);
    }

    public boolean Advance()
    {
        if (position == list.size() - 1 || position == ENDPOS)
        {
            position = ENDPOS;
            return false;
        }
        position++;
        return true;
    }

    public void Add(Tuples key)
    {
        list.add(key);
    }

    public boolean IsPastEnd()
    {
        return position == ENDPOS;
    }

    public void Print()
    {
        
    }

    /*public Relation(ArrayList<Integer> list)
    {
        this.list = list;
    }*/

    public Relation()
    {
        this.list = new ArrayList<Tuples>();
    }
}
